<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>validate</title>
</head>

<body>
<!--#include file="connectionString.asp"-->
<%
dim cnStr
dim rcSet
dim frmUsername
dim frmPassword
dim sqlStr

frmUsername=request.Form("username")
frmPassword=request.Form("password")
set cnStr=server.CreateObject("ADODB.Connection")
set rcSet=server.CreateObject("ADODB.Recordset")
cnStr.connectionstring=path
cnStr.provider=msProvider
cnStr.open
sqlStr="select * from validated_user where username='"&frmUsername&"' and password='"&frmPassword&"'"
set rcSet=cnStr.execute(sqlStr)
if (not rcSet.bof) and (not rcSet.eof) then
response.Cookies("validated_user")=frmUsername
response.Write("<h2>Login successful!</h2>")
response.Write("<p>Welcome "&rcSet.fields(1)&"</p>")
response.write("<p>Your full name is "&rcSet.fields(3)&"</p>")
else
response.write("<h2>"&"incorrect username and/or password"&"</h2>")
end if
%>
</body>
</html>
